<template>
  <div>
    <table class="table1 owntable mb20 tableLayout" border="0" cellspacing="0" cellpadding="1" width="100%">
      <tr>
        <td width="150">不合格品控制管理编号</td>
        <td>{{ item.number }}</td>
        <td width="150">不合格品类别</td>
        <td>{{ sampleList[item.controlType] }}</td>
      </tr>
      <tr>
        <td>{{ item.controlType == 0 ? '原材料批号' : '生产批号' }}</td>
        <td>{{ item.batchNumber }}</td>
        <td>管理部门</td>
        <td>{{ item.manageDeptName }}</td>
      </tr>
      <tr>
        <td>负责人</td>
        <td>{{ item.manageUserName }}</td>
        <td>编制部门</td>
        <td>{{ item.createDeptName }}</td>
      </tr>
    </table>
    <table class="table1 owntable tableLayout mb20" border="0" cellspacing="0" cellpadding="1" width="100%" v-for="v in item.failedList" :key="v.id">
      <tr v-if="item.controlType == 0">
        <td width="150">原材料名称</td>
        <td>{{ v.productName }}</td>
        <td width="150">原材料规格型号</td>
        <td>{{ v.productSku }}</td>
      </tr>
      <tr v-if="item.controlType == 0">
        <td>原材料编号</td>
        <td>{{ v.productNumber }}</td>
        <td>不合格数量</td>
        <td>{{ v.failedQty }}{{ v.unit }}</td>
      </tr>
      <tr v-if="item.controlType == 1">
        <td width="150">中间品名称</td>
        <td>{{ v.productName }}</td>
        <td width="150">中间品编号</td>
        <td>{{ v.productNumber }}</td>
      </tr>
      <tr v-if="item.controlType == 1">
        <td>中间品规格型号</td>
        <td>{{ v.productSku }}</td>
        <td>不合格数量</td>
        <td>{{ v.failedQty }}{{ v.unit }}</td>
      </tr>
      <tr v-if="item.controlType == 2">
        <td width="150">成品名称</td>
        <td>{{ v.productName }}</td>
        <td width="150">成品编号</td>
        <td>{{ v.productNumber }}</td>
      </tr>
      <tr v-if="item.controlType == 2">
        <td>成品规格型号</td>
        <td>{{ v.productSku }}</td>
        <td>不合格数量</td>
        <td>{{ v.failedQty }}{{ v.unit }}</td>
      </tr>
      <tr>
        <td>不合格处置</td>
        <td v-if="v.dealType">{{ dealTypeList[v.dealType].label }}</td>
        <td>不合格处置日期</td>
        <td>{{ v.dealDate }}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  props: {
    item: {},
  },
}
</script>

<style></style>
